package com.guguskins.back.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import com.fasterxml.jackson.annotation.JsonInclude;
import lombok.Data;
import lombok.EqualsAndHashCode;

import javax.validation.constraints.Min;
import javax.validation.constraints.NotEmpty;
import java.io.Serializable;
import java.math.BigDecimal;
import java.time.LocalDateTime;

/**
 * <p>
 * 折扣表
 * </p>
 *
 * @author mybatis-plus
 * @since 2021-07-14
 */
@Data
@EqualsAndHashCode(callSuper = false)
@TableName("gu_discount")
@JsonInclude(JsonInclude.Include.NON_EMPTY)
public class GuDiscount extends Model<GuDiscount> {

    private static final long serialVersionUID = 1L;

    @TableId(value = "dc_id", type = IdType.AUTO)
    private Integer dcId;
    @NotEmpty(message = "标题不能为空")
    private String dcTitle;
    /**
     * 折扣门槛
     */

    @Min(value = 0, message = "门槛至少是0")
    private BigDecimal dcThreshold;
    /**
     * 折扣
     */
    @Min(value = 0, message = "折扣至少是0")
    private BigDecimal dcDiscountSize;
    /**
     * 图片
     */
    private Integer dcBeOverdue;

    @NotEmpty(message = "图片不能为空")
    private String dcImages;
    private LocalDateTime dcInputTime;

    private LocalDateTime dcUpdateTime;
    private Boolean dcEnable;

    @Override
    protected Serializable pkVal() {
        return this.dcId;
    }

}
